//
//  CureMethodController.m
//  KMedicine
//
//  Created by 452608533 on 16/7/9.
//  Copyright © 2016年 caomu. All rights reserved.
//

#import "CureMethodController.h"

@interface CureMethodController ()

@property(nonatomic,strong) NSArray *dataArray;

@end

@implementation CureMethodController

- (NSArray *)dataArray{
    
    if (!_dataArray) {
        _dataArray = @[@"手术治疗",@"药物治疗",@"保守治疗"];
    }
    return _dataArray;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    
    self.tableView.tableFooterView = [[UIView alloc] init];
    
}



#pragma mark - Table view data source


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 3;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    
    cell.textLabel.text = self.dataArray[indexPath.row];
    
   
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (self.methodBlock) {
        self.methodBlock(self.dataArray[indexPath.row]);
    }
    
    [self.navigationController popViewControllerAnimated:YES];
}


@end
